

ifeq ($(TESTING),1)
TESTTARGET=testsuite
TESTSOURCE=testsuite.c
else
TESTTARGET=
TESTSOURCE=
endif

all: libx86asm.so $(TESTTARGET)

ifeq ($(TESTING),1)
$(TESTTARGET): $(TESTSOURCE) libx86asm.so
	gcc -g -lx86asm -L. -o $(TESTTARGET) $(TESTSOURCE)
	
endif

libx86asm.so: itoa.o
	ld -shared -s itoa.o -o libx86asm.so

itoa.o: itoa.asm
	nasm -f elf -g itoa.asm

clean:
	rm -Rf *.o
	rm -Rf *.so
	rm -Rf $(TESTTARGET)
